/**
 * Button.java
 */
package com;

/**
 * @author Administrator
 *
 */
/* The test class or client */
public class TestButton {
	public static void main(String[] args){
	      Light lamp = new Light();
	      Command switchUp = new FlipUpCommand(lamp);
	      Command switchDown = new FlipDownCommand(lamp);
	 
	      Invoker s = new Invoker();
	 
	      try {
	         if (args[0].equalsIgnoreCase("ON")) {
	            s.storeAndExecute(switchUp);
	            System.exit(0);
	         }
	         if (args[0].equalsIgnoreCase("OFF")) {
	            s.storeAndExecute(switchDown);
	            System.exit(0);
	         }
	         System.out.println("Argument \"ON\" or \"OFF\" is required.");
	      } catch (Exception e) {
	         System.out.println("Arguments required.");
	      }
	   }
}
